package com.breakfast.fun.data.entity.home;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by yukai on 16/10/5.
 */

public class Version {

    /**
     * total : 0
     * pageTotal : 0
     * data : {"id":1,"android":"2.5.1","androidUrl":"http://imtt.dd.qq.com/16891/130ED16A9480CFE65F4A1705F2A8C542.apk?fsname=com.breakfast.fun_2.5.1_13.apk&csr=4d5s","androidContent":"1.修复套餐多选后付款无法取消订单 \n2.修复节假日后周六日无法获取配送日期\n","androidFlag":0,"ios":"25","iosContent":"新版本更新：\n1、优化购买流程\n2、修复已知bug\n3、提升体验流畅度","iosFlag":1,"iosUrl":"https://itunes.apple.com/us/app/zao-fan-chi-zao-can-yao-you-fan!/id1015850227?l=zh&ls=1&mt=8"}
     * msg : 查询成功
     * success : true
     */

    private int total;
    private int pageTotal;
    /**
     * id : 1
     * android : 2.5.1
     * androidUrl : http://imtt.dd.qq.com/16891/130ED16A9480CFE65F4A1705F2A8C542.apk?fsname=com.breakfast.fun_2.5.1_13.apk&csr=4d5s
     * androidContent : 1.修复套餐多选后付款无法取消订单
     * 2.修复节假日后周六日无法获取配送日期
     * <p>
     * androidFlag : 0
     * ios : 25
     * iosContent : 新版本更新：
     * 1、优化购买流程
     * 2、修复已知bug
     * 3、提升体验流畅度
     * iosFlag : 1
     * iosUrl : https://itunes.apple.com/us/app/zao-fan-chi-zao-can-yao-you-fan!/id1015850227?l=zh&ls=1&mt=8
     */

    private DataBean data;
    private String msg;
    private boolean success;

    public static Version objectFromData(String str) {

        return new Gson().fromJson(str, Version.class);
    }

    public static List<Version> arrayVersionFromData(String str) {

        Type listType = new TypeToken<ArrayList<Version>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getPageTotal() {
        return pageTotal;
    }

    public void setPageTotal(int pageTotal) {
        this.pageTotal = pageTotal;
    }

    public DataBean getData() {
        return data;
    }

    public void setData(DataBean data) {
        this.data = data;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public static class DataBean {
        private int id;
        private String android;
        private String androidUrl;
        private String androidContent;
        private int androidFlag;
        private String ios;
        private String iosContent;
        private int iosFlag;
        private String iosUrl;

        public static DataBean objectFromData(String str) {

            return new Gson().fromJson(str, DataBean.class);
        }

        public static List<DataBean> arrayDataBeanFromData(String str) {

            Type listType = new TypeToken<ArrayList<DataBean>>() {
            }.getType();

            return new Gson().fromJson(str, listType);
        }

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getAndroid() {
            return android;
        }

        public void setAndroid(String android) {
            this.android = android;
        }

        public String getAndroidUrl() {
            return androidUrl;
        }

        public void setAndroidUrl(String androidUrl) {
            this.androidUrl = androidUrl;
        }

        public String getAndroidContent() {
            return androidContent;
        }

        public void setAndroidContent(String androidContent) {
            this.androidContent = androidContent;
        }

        public int getAndroidFlag() {
            return androidFlag;
        }

        public void setAndroidFlag(int androidFlag) {
            this.androidFlag = androidFlag;
        }

        public String getIos() {
            return ios;
        }

        public void setIos(String ios) {
            this.ios = ios;
        }

        public String getIosContent() {
            return iosContent;
        }

        public void setIosContent(String iosContent) {
            this.iosContent = iosContent;
        }

        public int getIosFlag() {
            return iosFlag;
        }

        public void setIosFlag(int iosFlag) {
            this.iosFlag = iosFlag;
        }

        public String getIosUrl() {
            return iosUrl;
        }

        public void setIosUrl(String iosUrl) {
            this.iosUrl = iosUrl;
        }
    }
}
